import std.algorithm;
import std.array;
import std.conv;
import std.datetime;
import std.parallelism;
import std.range;
import std.stdio;
import core.atomic;
import core.thread;

void main()
{
    immutable long n = 11;

    long[] z = [1,1,2,2,3,3,4,4,5,5,6,6,0,0];
    long j = 0;
    long l = z.length;

    StopWatch w; w.reset(); w.start;

    do
    {
        if (z[0] == 0) break; else
        {

            long m = 0;
            for (long i = 0; i < z.length; i += 2)
            {
                m += (z[i]*10 + z[i+1]);
            }
            if (m % n == 0) j++;
        }
    }
    while (nextPermutation(z));

    w.stop();
    j.writeln;
    w.peek().msecs.writeln;
} 
